package com.ers.service;

import java.util.List;

import com.ers.dao.UserDao;
import com.ers.model.User;

public class UserService {
	private UserDao userDao;
	
	public UserDao getUserDao() {
		return userDao;
	}
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public int add(User u){
		return userDao.save(u);
	}
	
	public List<User> searchByLoginName(String loginName, String password){
		return userDao.searchByLoginName(loginName,password);
	}
	
	public User loadById(int id){
		return userDao.loadById(id);
	}
	public boolean updateByInfo(User u) {
		return userDao.updateByInfo(u);	
	}
	public void resetPwd(String mailbox) {
		userDao.updatePwd(mailbox);
	}
}
